package tj.warning.pull.mapper.report2;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.cursor.Cursor;

import java.util.List;
import java.util.Map;

public interface Report2Mapper {
    @Select("<script>" +
            "<foreach collection='wellNumList' item='wellNum' separator='union all'>" +
                "select * from ${wellNum} @ljss where time &gt; #{endTime} " +
            "</foreach>" +
            "</script>")
    Cursor<Map<String,String>> getWellDrillingDetails(@Param("wellNumList") List<String> wellNumList, @Param("endTime") String endTime);

    /**
     * 从dblink链路中查询数据库中所有的表
     * @return
     */
    @Select("select table_name from USER_TABLES @ljss")
    List<String> getAllTableNameFromDbLink();

    @Select("select * from ${wellNum} @ljss where time > #{endTime}")
    Cursor<Map<String,String>> selectDataByWellNum(@Param("wellNum") String wellNum,@Param("startTime") String startTime,@Param("endTime") String endTime);

}
